<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			
			console.log(getDays(2015,3,1));
			function getDays(year,month,day){
				var arr = [31,28,31,30,31,30,31,31,30,31,30,31];
				for(var i = 0;i<month-1;i++){
					day += arr[i];
				}
				if(month>2 && isRN(year)){
					day += 1;
				}
				return day;
			}
			function isRN(year){
				if(yiar%4===0 && year%100!==0 || year%400===0){
					return true;
				}
				return false;
			}
		</script>
	</body>
</html>
